package com.sz.mes.dto;

import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.sz.mes.entity.Goods;
import com.diboot.iam.entity.IamUser;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import com.sz.mes.entity.GoodsTpye;
import com.sz.mes.entity.ProductTask;
import java.util.Date;
import com.diboot.core.util.D;

/**
 * 商品 DTO定义
 * @author hem
 * @version 1.0
 * @date 2023-06-14
 * Copyright © szhs
 */
@Getter
@Setter
@Accessors(chain = true)
public class GoodsDTO extends Goods {

    private static final long serialVersionUID = -4893578115976464914L;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.create_by=id")
    private String createByName;

    /**
     * 创建时间-起始
     */
    @BindQuery(comparison = Comparison.GE, field = "createTime")
    private Date createTime;

    /**
     * 创建时间-截止
     */
    @BindQuery(comparison = Comparison.LT, field = "createTime")
    private Date createTimeEnd;

    @Override()
    public Date getCreateTime() {
        return this.createTime;
    }

    @Override()
    public Goods setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public Date getCreateTimeEnd() {
        return D.nextDay(createTime);
    }

    public Goods setCreateTimeEnd(Date createTimeEnd) {
        this.createTimeEnd = createTimeEnd;
        return this;
    }
}
